<jsp:useBean id="bean" class="dasregistry.updateBean" scope="session"/> 
<jsp:directive.page import="org.biojava.dasobert.dasregistry.DasCoordinateSystem"/>
<jsp:directive.page import="java.util.*"/>
<jsp:setProperty name="bean" property="*"/>

<% String title="update test regions";
   String header=title;
%>



<%@ include file="sangerheader.jsp" %>

<div id="main">

<h2> Step 2/2 update test region</h2>
<%
String[] coords = bean.getCSTypes();
if ( coords.length == 0 ) {
   %>You did not choose a coordinate system!<%
} else {
%>
For validation of the server a test region needs to be provided for
each coordinate system.

<form action="editServerAction.jsp" method="post">
<div id="table">
<table>
<tr id="row0"><td colspan="2">test regions for DAS source <%=bean.getNickname()%></td></tr>
<%
String[] testCodes = bean.getTestCodes();
for (int i=0;i<coords.length;i++){
    String coord = coords[i];
    %><tr id="row1"><td>coordinate system:</td>
       <td><input type="hidden" name="CSTypes" value="<%=coord%>"/><%=coord%></td></tr>
       <tr id="row2"><td colspan="2"><input type="text" name="testCodes" size="60" <% 
       
       if (( testCodes != null ) && (testCodes.length > 0) && (testCodes.length > i)) {
	  	%>value="<%=testCodes[i]%>" <%
       }
       %>/></td></tr>
       
    <%
}
%>
</table>
</div>
<input type="submit" value="update" >
<input type="hidden" name="auto_id"     value="<%=request.getParameter("auto_id")%>"/>
<input type="hidden" name="nickname"    value="<%=bean.getNickname()%>"/>
<input type="hidden" name="dasurl"      value="<%=bean.getDasurl()%>"/>
<input type="hidden" name="adminemail"  value="<%=bean.getAdminemail()%>"/>
<input type="hidden" name="description" value="<%=bean.getDescription()%>"/>
<input type="hidden" name="alertAdmin"  value="<%=bean.getAlertAdmin()%>"/>
<input type="hidden" name="spec"  value="<%=bean.getSpec()%>"/>
<%
String[] caps = bean.getCapabilities();
for (int i=0;i<caps.length;i++) {
    String cap = caps[i];
    %><input type="hidden" name="capabilities" value="<%=cap%>"/>
<%
}
%>
<input type="hidden" name="helperurl" value="<%=bean.getHelperurl()%>"/>
<input type="hidden" name="helperurl" value="<%=bean.getHelperurl()%>"/>
<%
String[] labels = bean.getLabels();
for (int i=0; i< labels.length;i++){
    String label = labels[i];
    %><input type="hidden" name="labels" value="<%=label%>"/>
<%
}
String alert = bean.getAlertAdmin();
if ( (alert != null) && (alert.equals("1")) ) {
%><input type="hidden" name="alertMe" value="<%= bean.getAlertAdmin()%>"/>
<% } %>
</form>
<%}%>
</div>
<%@ include file="sangerfooter.jsp" %>


